package com.sansi.bleFloodlight.activity;

import android.os.Bundle;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.alibaba.android.arouter.facade.annotation.Route;

import com.my.httpapi.api.annotation.Layout;
import com.my.httpapi.api.baseView.BaseActivity;
import com.sansi.bleFloodlight.R;
import com.sansi.bleFloodlight.adapter.ConnectFailResonAdapter;
import com.sansi.bleFloodlight.utils.RouterPath;

import java.util.ArrayList;
import java.util.List;

@Layout(R.layout.layout_activity_connect_fail)
@Route(path = RouterPath.bleConnectFailPath)
public class ConnectFailActivity extends BaseActivity {

    private RecyclerView recyclerView;
    private ConnectFailResonAdapter connectFailResonAdapter;
    private List<String> list=new ArrayList<>();
    @Override
    protected void initView() {
        recyclerView=findViewById(R.id.recycler_view);
    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
        recyclerView.setLayoutManager(linearLayoutManager);
        connectFailResonAdapter = new ConnectFailResonAdapter();
        recyclerView.setAdapter(connectFailResonAdapter);
        createData();
    }

    @Override
    protected void destory() {

    }

    @Override
    protected String showTitle() {
        return "Why it failed?";
    }

    @Override
    protected boolean statusBarIsBlack() {
        return false;
    }

    @Override
    protected boolean showLeftArrow() {
        return true;
    }


    private void createData(){
        for(int i=0;i<4;i++){
            list.add("为什么会失败的原因");
        }
        connectFailResonAdapter.setNewData(list);
    }
}
